{template header}
<link rel="stylesheet" href="/static/calendar/js/calendar.css" />
<script type="text/javascript" charset="utf-8" src="/static/calendar/calendar.php"></script>
<script type="text/javascript" charset="utf-8" src="/static/highcharts/js/highcharts.js"></script>
<script type="text/javascript" charset="utf-8" src="/static/highcharts/js/modules/exporting.js"></script>
<h4 style="padding-left:10px;;">
    <span>搜索</span>
    <i class="icon-search"></i>
</h4>
<form class="form-horizontal" method="post" action="">

    <div class="control-group search-group"style="margin:0;">
        <label class="control-label" >开始日期：</label>
        <div class="controls">
            <input type="text" name="start_time" id="start_time_id" value="{$viewDatas['sTime']}">
            <button name="start_time_btn" type="button" id="start_time_btn" onclick="return showCalendar('start_time_id', '%Y-%m-%d', '24', false, 'start_time_btn');" class="button" id="start_time_id"/>选择</button>
        </div>
    </div>
    <div class="control-group search-group" style="margin:0;">
        <label class="control-label" >结束日期：</label>
        <div class="controls">
            <input type="text" name="end_time" id="end_time_id" value="{$viewDatas['eTime']}">
            <button name="end_time_btn" type="button" id="end_time_btn" onclick="return showCalendar('end_time_id', '%Y-%m-%d', '24', false, 'end_time_btn');" class="button" id="end_time_id"/>选择</button>
        </div>
    </div>

    <div class="control-group search-group" style="margin:0;" >
        <div class="controls">
            <button class="btn" type="submit">提交</button>　
        </div>
    </div>
</form>
统计图（{$viewDatas['timeDur']}）
<div id="container" style="min-width: 310px; height: 400px; margin: 0 aut;"></div>

异常统计（{$viewDatas['timeDur']}）
<div class="bs-docs-example" style="clear:both;">
    <div style="height:600px; overflow:scroll;">
        {if !empty($viewDatas['excp'])}
        <table class="table table-striped">
            <thead>
                <tr>
                    <th>机型&系统版本</th>
                    {loop $viewDatas['dateArr'] $k $v}
                        <th>$v</th>
                    {/loop}
                </tr>
            </thead>
            <tbody>
                {loop $viewDatas['series'] $sk $sv}
                        <tr>
                            <td>{$sv}</td>
                            {loop $viewDatas['dateArr'] $dk $dv}
                                <td>
                                    {eval if (!empty($viewDatas['excp'][$dv][$sv])) echo $viewDatas['excp'][$dv][$sv]; else echo '0';}
                                </td>
                            {/loop}
                        </tr>
                {/loop}
            </tbody>
        </table>
        {/if}
    </div>
    
    近期总汇（{$viewDatas['timeDur']}）
    <table class="table table-striped">
        <thead>
            <tr>
                <th>日期</th>
                <th>日志总数</th>
                <th>异常总数</th>
            </tr>
        </thead>
        <tbody>
            {if !empty($viewDatas['week'])}
                {loop $viewDatas['week'] $k $v}
                <tr>
                    <td>{$k}</td>
                    <td>{$v['total']}</td>
                    <td>{$v['excep']}</td>
                </tr>
                {/loop}
            {/if}
        </tbody>
    </table>
</div>
<script type="text/javascript">
    $(function() {
        var chartOpt = '{$viewDatas["chart"]}';
        chartOpt = JSON.parse(chartOpt);
        chartOpt.tooltip.formatter = function() {return this.series.name + ": " + this.y};
        console.log(chartOpt);
        $('#container').highcharts(chartOpt);
    });
</script>
{template footer}
